package cn.zhaoguang.usedcar.main.mapper;

import cn.zhaoguang.usedcar.main.common.BaseTkMapper;
import cn.zhaoguang.usedcar.main.entity.Collection;
import cn.zhaoguang.usedcar.main.entity.dto.CollectionDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CollectionMapper extends BaseTkMapper<Collection> {
    /**
     * @Description 添加收藏，返回主键
     * @Author zhaoguang
     */
    Integer save(Collection collection);

    /**
     * @Description 查询此用户是否收藏有此辆车(在查询车辆详情接口处使用)
     * @Author zhaoguang
     */
    Integer findCollectionByUserId(@Param("userId") Integer userId, @Param("usedcarId") Integer usedcarId);

    /**
     * @Description 查询此用户全部的收藏
     * @Author zhaoguang
     */
    List<CollectionDTO> findAll(@Param("userId") Integer userId);
}